package com.lm.itextpdf.example;

import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;

public class CreatePDFExample {
    public static void main(String[] args) throws Exception {
        String dest = "f://example.pdf";
        PdfWriter writer = new PdfWriter(dest);
        PdfDocument pdfDoc = new PdfDocument(writer);
        Document document = new Document(pdfDoc);

        document.add(new Paragraph("Hello, iTextPDF!"));
        document.close();
        writer.close();

        System.out.println("PDF created at: " + dest);
    }
}
